package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.JiajiaTimePriceConfig;
import com.ruoyi.system.mapper.JiajiaTimePriceConfigMapper;
import com.ruoyi.system.service.IJiajiaTimePriceConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 时间价格配置Service业务层处理
 * 
 * @author 郑鑫
 * @date 2024-04-23
 */
@Service
public class JiajiaTimePriceConfigServiceImpl implements IJiajiaTimePriceConfigService
{
    @Autowired
    private JiajiaTimePriceConfigMapper jiajiaTimePriceConfigMapper;

    /**
     * 查询时间价格配置
     * 
     * @param id 时间价格配置主键
     * @return 时间价格配置
     */
    @Override
    public JiajiaTimePriceConfig selectJiajiaTimePriceConfigById(Long id)
    {
        return jiajiaTimePriceConfigMapper.selectJiajiaTimePriceConfigById(id);
    }

    /**
     * 查询时间价格配置列表
     * 
     * @param jiajiaTimePriceConfig 时间价格配置
     * @return 时间价格配置
     */
    @Override
    public List<JiajiaTimePriceConfig> selectJiajiaTimePriceConfigList(JiajiaTimePriceConfig jiajiaTimePriceConfig)
    {
        return jiajiaTimePriceConfigMapper.selectJiajiaTimePriceConfigList(jiajiaTimePriceConfig);
    }

    /**
     * 新增时间价格配置
     * 
     * @param jiajiaTimePriceConfig 时间价格配置
     * @return 结果
     */
    @Override
    public int insertJiajiaTimePriceConfig(JiajiaTimePriceConfig jiajiaTimePriceConfig)
    {
        jiajiaTimePriceConfig.setCreateTime(DateUtils.getNowDate());
        return jiajiaTimePriceConfigMapper.insertJiajiaTimePriceConfig(jiajiaTimePriceConfig);
    }

    /**
     * 修改时间价格配置
     * 
     * @param jiajiaTimePriceConfig 时间价格配置
     * @return 结果
     */
    @Override
    public int updateJiajiaTimePriceConfig(JiajiaTimePriceConfig jiajiaTimePriceConfig)
    {
        jiajiaTimePriceConfig.setUpdateTime(DateUtils.getNowDate());
        return jiajiaTimePriceConfigMapper.updateJiajiaTimePriceConfig(jiajiaTimePriceConfig);
    }

    /**
     * 批量删除时间价格配置
     * 
     * @param ids 需要删除的时间价格配置主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaTimePriceConfigByIds(String ids)
    {
        return jiajiaTimePriceConfigMapper.deleteJiajiaTimePriceConfigByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除时间价格配置信息
     * 
     * @param id 时间价格配置主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaTimePriceConfigById(Long id)
    {
        return jiajiaTimePriceConfigMapper.deleteJiajiaTimePriceConfigById(id);
    }
}
